package com.qf.auth.api;

import com.qf.auth.service.CheckCodeService;
import com.qf.common.bean.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.ReactiveSubscription;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/auth/checkcode")
public class CheckCodeController {

    @Autowired
    private CheckCodeService checkCodeService;

    /**
     * 发送短信验证码
     * @return
     */
    @PostMapping("/send")
    public R send(String phone) {
        try {
            R result = checkCodeService.send(phone);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
